Dynamic link distance configuration for extended fabric

ABSTRACT

A method to dynamically allocate credits for a particular port to port link based on measured link distance during the initial interswitch link configuration process. An apparatus implementing such method or a software upgrade to retrofit existing switches.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present disclosure is a continuation of U.S. patent application Ser.No. 10/356,654, entitled “Dynamic Link Distance Configuration forExtended Fabric” by Nagaraj Lalsangi and Balakrishma Wusirika, filedJan. 31, 2003, which is hereby incorporated by reference. The presentdisclosure is also related to and incorporates by reference, U.S. patentapplication Ser. Nos. 09/872,412 (now U.S. Pat. No. 7,447,198), entitled“Link Trunking and Measuring Link Latency in Fibre Channel Fabric” byDavid C. Banks, Kreg A. Martin, Shunjia Yu, Jieming Zhu and Kevan K.Kwong, filed Jun. 1, 2001; 10/207,541 (now U.S. Pat. No. 7,301,898)entitled “Credit Sharing for Fibre Channel Links with Multiple VirtualChannels” by Kreg A, Martin and David C. Banks, filed Jul. 29, 2002;10/207,361, 10/348,067 and 11/747,671 (all now abandoned) all entitled“Cascade Credit Sharing for Fibre Channel Links” and all by Kreg A.Martin and Shahe H. Krakirian, respectively filed Jul. 29, 2002, Jan.21, 2003 and May 11, 2007; and 10/205,793 (now U.S. Pat. No. 7,286,527)entitled “Method and Apparatus for Round trip Delay Measurement in aBi-directional, Point-to-Point, Serial Data Channel” by Farid A. Yazdyand Kreg A. Martin, filed Jul. 26, 2002.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates generally to network switching devices and moreparticularly to Fibre Channel switching devices and the dynamic creditallocation for a port based on the port-to-port link distance.

2. Description of the Related Art

The Fibre Channel family of standards (developed by the AmericanNational Standards Institute (ANSI)) defines a high speed communicationsinterface for the transfer of large amounts of data between a variety ofhardware systems such as personal computers, workstations, mainframes,supercomputers, storage devices and servers that have Fibre Channelinterfaces. Use of Fibre Channel is proliferating in client/serverapplications which demand high bandwidth and low latency I/O such asmass storage, medical and scientific imaging, multimedia communication,transaction processing, distributed computing and distributed databaseprocessing applications. U.S. Pat. No. 6,160,813 to Banks et al.discloses one of the state of the art Fibre Channel switch systems,which is hereby incorporated by reference.

One or more interconnected switches form a network, called a fabric,which other devices, such as mass storage devices, servers orworkstations, can be connected to. Any devices connecting to a fabriccan communicate with any other devices connected to the fabric. A directconnection between two devices is a link. An interface on a device forconnecting another device is a port. A non-switch device connecting to afabric is a node on the network or fabric. A port on a non-switch andnon-hub device is an N-port. A port on a switch may be an E-port, forconnection to another switch port, an F-port, for connection to anN-port, an FL port for connection to an FC-AL loop or any combination ofthe above. A link between two switches is an inter-switch link (ISL).

Each port has a transmitter and a receiver. The transmitter sends outinformation and the receiver receives incoming information. There arebuffer memories associated with each port, either the transmitter or thereceiver, to temporarily store the information in transit, before theinformation is confirmed to be transmitted towards its destination by aswitch, or to be stored or used by a device at its destination. Thebuffer memory can be in the actual port or, preferably, may becentralized, as shown in U.S. Pat. No. 6,160,813. The buffer memory isbroken down into units. One unit of buffer memory, which can hold oneframe, is represented by one buffer-to-buffer credit or one credit. Aframe is a unit of information transmitted, which comprises a headerportion and a payload portion. The header portion identifies the frame,including a Source Identification (SID) and a Destination Identification(DID). The payload portion contains the data being transmitted. A framemay be 2112 data bytes long, which, plus header, CRC, EOF totals 2148bytes.

In the prior art, a receiver on a port is allocated a fixed amount ofbuffer space to temporarily store received frames, represented by afixed number of buffer-to-buffer credits. The receiver controls theallocation of the buffer space. At the initial configuration when twoswitches connect, the receivers advertise to the transmitters the amountof buffer space represented by the number of credits available. Thetransmitters initialize their credit counters to the number of creditsadvertised by the receivers. Both the transmitting port and receivingport keep track of the use of the buffer space using the number ofcredits and credit counters. Each time a frame is received by thereceiver, the frame is stored in a buffer space and the number ofcredits residing in the receiver is increased by one. The transmittingport keeps track of this by reducing its transmitter credit counter,which indicates how many more frames can be sent, while the receiverincrements its receiver credit counter, which indicates how many framesare stored in the buffer space. Once the frame is confirmed to have beenretransmitted by a transmitter on the receiving switch, or used by adevice, then the buffer space is free to be used to store a new frame.At that time, a credit is returned by a transmitter on the receivingport to a receiver on the transmitting port and the receiver creditcounter in the receiving port is decreased by one. When the transmittingport receives the credit, the transmitter credit counter in thetransmitting port is increased by one.

Even though frames travel through the fiber optics at the speed oflight, it still takes time for frames to move from one device toanother. It also takes time for a device to receive a frame; process itor retransmit it; and then return a credit, i.e. a confirmation ofreceipt, back to the transmitting port. It takes some more time for thecredit traveling through the optical fiber to reach the transmittingport. During the turn-around time between when the transmitting portsends out a frame and the transmitting port receives a credit, thetransmitting port may have sent out a number of frames at itstransmitting speed if the transmitting port has available credits. Whenthe transmitting port has at least a minimum number of credits to allowthe transmitting port to continue transmitting until it receives creditsback from the receiving port, the effective frame transmission rate isthe highest. If the transmitting port does not have that minimum numberof credits, then it has to temporarily stop sending frames when all thecredits are used and wait until the credits return. Due to thisstoppage, the effective frame transmission rate may be substantiallylower than the actual transmission rate. That minimum number of creditsdepends on the turn-around time and the frame transmitting speed. Thelonger the transmission line, or the faster the transmitting speed, themore frames that may be in transit. At a fixed transmitter speed, themore credits a port can have, the longer the transmission distance canbe while the link still maintains the full effective transmitter speed.

In the prior art, the number of credits allocated to a port is fixed,but the distance between ports may be different. For long distant links,there may not be enough credits to sustain the full speed of thetransmitters. For shorter distance links, there may be more credits thannecessary such that some of the buffer space or credits are wasted. Evenfor Fibre Channel switches where the buffer memory are centrallyallocated and controlled, the amount of credits or buffer spaceallocated to each port is still fixed. To alleviate such problem, insome other prior art Fibre Channel switches, an installer of thephysical port to port link may manually configure the buffer spacededicated for a particular port depending on the distance between theport to port link. There may be discreet distant levels that aninstaller can select, such as 5, 10, 50, 100 kilometers. Still manytimes these levels are too far higher than the actual link distancedeployed by the Fibre Channel network installer. For a givenconfiguration, a particular distance level setting may be wastefulbecause it will over-commit the buffer credits based on next higherlevel. With the advancing in the speed of Fibre Channel switches and thedistance of the Fibre Channel links, the demand for buffer space orcredits is increasing. The inflexibility of buffer space or creditsallocation becomes increasingly costly.

Therefore, it is desirable to have a method to match the credit demandfor a port connecting to a port to port link to the available credits ona Fibre Channel switch. It is also desirable to have devices toimplement such a method.

BRIEF SUMMARY OF THE INVENTION

The present invention utilizes a dynamic link distance configuration toallocate credits for a particular port to port link. During the initialinterswitch link configuration process, the actual distance between thetwo connecting port is measured and the demand for credits iscalculated. Such amount of credits is allocated to this link. Thepresent invention can be implemented in the hardware of a Fibre Channelswitch itself or as software upgrades to retrofit existing Fibre Channelswitches, assuming the switch includes the link timer hardware.

BRIEF DESCRIPTION OF THE DRAWINGS

A better understanding of the invention can be had when the followingdetailed description of the preferred embodiments is considered inconjunction with the following drawings, in which:

FIG. 1 is a block diagram of a typical fabric with connecting devices.

FIG. 2 is a block diagram of a two switch, four device network showingthe interconnections, where the buffer memory for each port is centrallyallocated and controlled on the switches.

FIG. 3 is a block diagram of a two switch, four device network showingthe interconnections similar to the ones shown in FIG. 2, except thatthe buffer memory allocated to each port is dynamically allocated duringthe initial port to port configuration.

FIG. 4 shows a portion of the port to port initial configuration, wherethe distance between the ports is measured and the amount of necessarycredits is determined.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

FIG. 1 depicts a typical Storage Area Network (SAN) 20 utilizing a FibreChannel network. A fabric 32 may comprise one or more switches 30. Threeswitches 30 are shown. Many devices or nodes, such as a general storagedevice 24, a server 26, database storage devices 28 and a loop 22(itself comprised of devices, not shown) are connected to the fabric 32.Any devices on the fabric 32 can communicate to any other devices on thefabric 32.

FIG. 2 is a block diagram showing more details of several particularinterconnections in a portion of a SAN 40. Two switches 72 and 74 areshown, together with two servers 52, 54 and two storage devices 62, 64.The N-ports 102, 104, 106 and 108 on servers 52 and 54, and storagedevices 62 and 64, and their corresponding F-ports 66, 68, 76 and 78 onthe switches 72 and 74 are linked by links 82, 84, 86 and 88. The twoswitches 72 and 74 have one E-port each, 44 and 46, which are connectedthrough ISL 90. Each switch may also have a central memory 56 and 58 inswitches 72 and 74, for buffering information in transit and a controlmodule (not shown) for managing the information flow, such as directingflows of information and managing the buffer space. Each port has atransmitter (T) and a receiver (R). The available buffer spaces in thecentral memory are allocated among the ports on the switch.

The available buffer space for each port can reside on the individualport or can reside centrally in the switch. Either way, the buffer spaceallocated to each port on the switch is fixed at a single amount by theswitch manufacturer or at very few discreet levels that can be selectedby the installer. In FIG. 2, each port 44, 66, 45, and 68 on switch 72are allocated one quarter of the central memory 56. Buffer memory 144,166, 145 and 168 are dedicated to port 44, 66, 45, and 68. Similarly, aquarter of the central buffer space 58, i.e., 147, 176, 146 and 178 areallocated to port 47, 76, 46, and 78 on switch 74. Buffer space 145 and147 which are allocated to port 45 and 47 are wasted because neither ofthose two ports is in use in this network.

FIG. 3 shows the same network configuration as in FIG. 2 except thebuffer space allocations for the ports have changed. In this embodimentof the present invention, the allocation of buffer space to the ports isallocated dynamically based on the actual distance between the ports.The port 45 on switch 72 and port 47 on switch 74 are not in use,therefore, those two ports are not allocated any buffer space. The linkbetween ports 44 and 46 is longer and also the demand for credits ismore between those two ports, therefore the buffer space allocated tothese two ports on each switch is bigger. The buffer spaces 244, 266,245 and 268 allocated to ports 44, 66, 45, and 68 on switch 72 aredifferent and are based on the needs for each port. The buffer space 245allocated to port 45 is at its minimum. Similarly, buffer spaces 246,276, 247, and 278 allocated to ports 46, 76, 47, and 78 on switch 74 areof various sizes, and buffer space 245 is at its minimum. The actualdetermination of the buffer space or credit for each port will bedescribed later.

FIG. 4 shows a portion of the initial configuration that measures thedistance between the two ports and determines the amount of credits orbuffer space needed for the link. The direction from top to bottom onFIG. 4 is the direction of time. As shown in FIG. 4, there may be otherprocesses before and after the measurement of distance and thedetermination of the credit need during the initial configurationprocess. When port 44 and port 46 physically connect, the initialconfiguration starts. After the initial device identification and someother configuration, the measurement of the distance between the twoports and buffer space determination can begin. Each port on any deviceson a Fibre Channel network has its own unique identification. In thiscase, the world-wide number (WWN) may be used as such deviceidentification. At the initial device identification, WWN of each portis exchanged.

Continue referring FIG. 4, at time point 302, switch 72 uses port 44 tosend an ELP or Extended Link Parameters ILS packet to port 46 of switch74. At the earlier or later time 404, switch 74 may use port 46 to alsosend an ELP packet to port 44. This packet is to determine which porthas a higher WWN, and may be used to determine which port will act asthe initiator port or target port. An initiator port is the port thatmeasures and determines the distance and buffer space for the link. Atarget port returns signals coming from the initiator port, but itselfdoes not determine the link distance or the credit demand. It isimmaterial which port acts as the initiator port or the target port, solong the two ports agree to the roles they play in the distancemeasurement. In the preferred embodiment, the ports use WWN to determinewhich one is the initiator port. In the preferred embodiment, theinitiator port is the port having the higher WWN during the portinitialization and the target port is the port with the lower WWN duringthe port initialization. In the example shown in FIG. 4, port 44 has ahigher WWN than port 46, so port 44 is the initiator port and port 46 isthe target port in this connection.

The next several exchanges of signals confirm that port 44 has a higherWWN then port 46. At time 304, port 44 receives the ELP packet from port46 and at time 306 switch 72 sends out an ELPRJT or ELP Reject packetback to port 46 which receives the ELPRJT at time 406, meaning “port 46has a lower WWN than port 44.” Similarly, port 46 at time 402 receivesthe ELP packet from port 44 and switch 74 responds at time 408 an ELPACCor ELP Accept packet back to port 44, which receives the ELPACC packetat time 308, meaning “port 44 has a higher WWN than port 46.”

A port on a switch which supports dynamically allocating the amount ofcredits for the port is referred to as supporting the LD mode ofoperation. For a port to port to operate in the LD mode, both ports onthe link must support the LD mode, i.e. participate in the distancemeasurement and credits determination. It is not essential to make theinquiry, but the inquiry makes sure that the time/distance measurementcan be used. So one of the ports inquires of the other port and confirmsthat both ports support the LD mode and both are using the same protocolin carrying out the distance measurement and credit determination. Thisis illustrated in the next few exchanges of signals in FIG. 4. Switch 72uses port 44 at time 310 to send an ELP packet to port 46 to inquire ofport 46 whether port 46 would support the LD mode, which is the dynamiclong distance configuration mode. At time 410, port 46 receives the ELPpacket and at time 412 switch 74 responds with an ELPACC packet back toport 44, which port 44 receives at time 312. The ELPACC packet confirmsthat port 46 supports the LD mode. In the preferred embodiment, asindicated earlier, WWN is used to determine the initiator/target portsand that the port having the higher WWN is the initiator port. It isobvious that any identifiers that may be used in place of WWN and anyunique sequence, such as numerical or alphabetical may be used todetermine which port is the initiator port and which port is the targetport. Once ELP and ELPACC packets are exchanged, both ports know thatthey will follow the same protocol, i.e. LD mode, to measure thedistance and each one knows the exact action it will take under theprotocol.

After port 46 responds with the ELPACC packet, it is ready to return thenext packet from port 44, which will be a Mark primitive, a uniquepacket used to measure time elapsed in the link. Return here means thatport 46 will respond to a packet coming from port 44 immediately afterport 46 receives the signal without any processing in the port 46. TheMark primitive is essentially a light pulse and port 46 is acting as amirror. The port 44 emits a light pulse (Mark primitive). The lightpulse (Mark primitive) is returned or reflected by port 46 and receivedby port 44. Once port 44 receives the ELPACC packet at time 312, theswitch 72 knows that port 46 supports the LD mode and it is ready to dothe distance measurement. The above preparatory steps are useful and areimplemented in some embodiments of the current invention, but they arenot essential.

In the following steps, time/distance is measured. At time 314, switch72 uses port 44 to send out the Mark primitive to port 46 and at thesame time starts a timer to measure the time elapsed between now andwhen the Mark primitive return packet comes back from port 46. Port 46will receive the Mark primitive at time 414 and immediately return itback to port 44 (i.e. reflect the light pulse back). The port 44receives the Mark primitive at time 316 and stops the timer immediately.The time difference between time 316 and 314 is the time that the Markprimitive takes to travel a round trip between the two ports 44 and 46.The packet is traveling at a substantially known portion of the speed oflight in the link so the distance can be calculated by multiplying thetime period between time 316 and 314 by the speed of light in the fabricand other values. By time 320, the distance is determined and the numberof buffer credits can be determined by a formula depending on thedistance.

The link distance can be calculated as follows:

DISTANCE=(LRT_LATENCY*3)/(20*RI)  Eq. (1)

Where DISTANCE is the link distance in km;

LRT_LATENCY is the time lapse between time 316 and 314, in microseconds

RI is the refractive index of glass (worst case)

For a given link distance, buffer credits required are about 1 per kmfor 2 Gbit/sec links and 0.5 per km for 1 Gbit/sec links, approximatelybased on the equation below:

Number ofcredits=((20*RI*DISTANCE)/3)*(100/MAX_FRAME_SIZE)*LINE_RATE+2  Eq. (2)

Where MAX_FRAME_SIZE is the max frame size in FC, usually 2148 bytes

LINE_RATE is the raw data rate of link, in Gb/s.

The extra 2 credits in Eq. (2) are the usual amount of credit allowancefor the latency within a switch for processing a signal/frame and/orother delays. The latency within a switch is the time between a portreceiving a frame/signal, processing it, and responding orretransmitting the frame/signal. This latency within a switch is switchdependent and could be different for different switches.

When distance information is not needed, Eq. (1) and Eq. (2) can becombined to get the direct relationship between time latency and thedesired amount of credits:

Number of credits=(LRT_LATENCY*LINE_RATE*100)/MAX_FRAME_SIZE+2  Eq. (3)

LRT_LATENCY is the time lapse between timer stops and starts, inmicrosecond

LINE_RATE is the raw data rate of the link in Gb/sec,

MAX_FRAME_SIZE is the maximum size of a frame transmitted by the ports,usually 2148 bytes.

In one of the embodiments, the timer is a counter, counting at a rate ofabout 106.25 MHz. The maximum value of the counter is 524287 (0x7ffff).The time-out is triggered when the timer/counter exceeds 524287, orabout 5 ms. When a time-out occurs, a message is generated indicatingthat the current measurement has failed. Generally another attempt ismade under such conditions until a pre-determined number of attemptshave been made, at which time a message is generated indicating failureof the measurement process. Table 1 shows the typical link latency andcorresponding distance and buffer credit allocation.

TABLE 1 Link round trip Buffer credits Buffer credits latency Linkdistance (# of frames) (# of frames) (micro second) (km) 2 G link 1 Glink 1000 100 100 50 800 80 80 40 600 60 60 30 400 40 40 20 200 20 20 10100 10 10 5

The number of credits according to Eq. (2) is the desired amount ofcredits for a port at the link distance. In the case that there are notenough credits on the switch to satisfy the demands from all ports, thenonly a portion of the demand for some ports can be satisfied. There arevarious ways to pick and choose, i.e. priority schemes. One priorityscheme can be the first come first serve scheme: the available creditsare used to satisfy the first connected port. The left over credits willbe used to satisfy the demand of next connected port, and so on untilall the credits are allocated. Then the remaining ports on the switchare no longer useable, i.e. cannot be used to connect to other ports.Another priority scheme can be an even distribution scheme: when thetotal demand for credits from all connected ports is more than the totalavailable credits, then the same percentage of demanded credits isallocated (satisfied) for all ports, so that the total allocated creditsis equal to the total available credits. This way, all the ports on aswitch are useable, albeit at a lower effective speed due to the lack ofcredits. A formula for performing this even distribution scheme is:

Nai=Ni*(Total number of credits on switch)/sum(Number of credits of allports),

-   -   where Nai is the amount of credits reallocated to port i,    -   Ni is the amount of credits allocated to port i by the equation        above, and    -   Sum (number of credits of all ports) is the sum of credits        allocated to all ports as in the equation above.

After the switch 72 has determined the number of credits needed for thelink 90, the switch 72 uses port 44 to send an ECP or Extended CreditParameters ILS packet to port 46 at time 318. This is a new ILS, whichis preferred over using an ELP to allow simplified ELP processing, butan ELP can be used if desired. The ECP packet contains the needed creditinformation so that switch 74 can set up port 46 like switch 72 will setup port 44. The switch 74 replies with an ECPACC or ECP Accept packet attime 416 to indicate that the credit information will be used to set upport 46. When switch 72 receives the ECPACC packet at time 320 at port44, the credit information is applied to port 44. If the switch 74replies with an ECPRJT or ECP Reject packet, the credit information isnot applied to either port 44 or port 46, but the credit allocation isdetermined by other means.

After the ECP packet handshake, the remaining configuration operationsoccur.

The present invention may be implemented in many ways. For example, thepresent invention may be implemented in a software format, as a machinereadable, machine executable program. The software program executing thepresent invention can be loaded into a processor or control module on aswitch, or a buffer credit management module on a switch, during a powerup initialization or a later set-up. This presumes that the hardwareportions of the buffer credit logic are sufficiently programmable or aremade sufficiently programmable to handle the changing creditallocations.

The present invention may also be implemented in hardware format, as anew switch having the new credit sharing scheme built into the hardware.

While illustrative embodiments of the invention have been illustratedand described, it will be appreciated that various changes can be madetherein without departing from the spirit and scope of the invention.

Titles and subtitles used in the text are intended only as focal pointsand an organization tool. These titles are not intended to specificallydescribe the applicable discussion or imply any limitation of thatdiscussion.

1. A method to dynamically allocate credits to a port in a Fibre Channelnetwork, the method comprising: a first port sending a unique signal toa second port and starting a timer; the first port receiving the uniquesignal returned from the second port and stopping the timer; andallocating credits according to the time elapsed on the timer; whereinallocating credits according to the time elapsed on the timer includes:calculating the distance according to the time elapsed on the timer; andallocating credits corresponding to the distance between the first andsecond ports, and wherein calculating the distance according to the timeelapsed on the timer uses the following formula:distance=(LRT_LATENCY*3)/(20*RI), where distance is the link distance inkm, LRT_LATENCY is the time lapse between timer stops and starts, inmicroseconds, and RI is the refractive index of glass (worst case) inthe fiber optic connecting the two ports.
 2. The method in claim 1,wherein the timer has a time-out limit; and wherein when the timerreaches the time-out limit before receiving the unique signal returnedfrom the second port, the timer is stopped and a message is generated.3. The method in claim 1, further comprising: the first device inquiringof the second device whether the second port supports a mode todynamically allocate credits; and the second device responding to thefirst device that the second port supports the mode to dynamicallyallocate credits.
 4. The method in claim 1, further comprising: thefirst port and the second port exchanging identities wherein theidentities follows a defined sequence; wherein the first port identityis in front of the second port identity in the sequence.
 5. The methodin claim 1, wherein the link has a LINE_RATE, the raw data rate of thelink in Gb/sec and the frames transmitted has a MAX_FRAME_SIZE which isthe maximum size of a frame transmitted by the ports; and whereinallocating credits corresponding to the distance for one of the firstand second ports, the amount of credit allocated is determined by thefollowing formula:Number of credits=((20*RI*DISTANCE)/3)*(100/MAX_FRAME_SIZE)*LINE_RATE+K,where K is a constant provided to allow for intraswitch latencies. 6.The method in claim 5, wherein the first device having the first porthas one or more other ports, and the credits available on the firstdevice are allocated to connected ports on a first come, first servebasis until all credits are used.
 7. The method in claim 5, wherein thefirst device having the first port has one or more other ports, furthercomprising: allocating the amount of credits to each port, such that:Nai=Ni*(Total number of credits on switch)/sum(Number of credits of allports), where Nai is the amount of credits reallocated to port i, Ni isthe amount of credits allocated to port i in claim 5, and Sum (number ofcredits of all ports) is the sum of credits allocated to all ports as inclaim
 5. 8. A method to dynamically allocate credits to a port in aFibre Channel network, the method comprising: connecting a first port ona first device to a second port on a second device to form a link; thefirst port sending a unique signal to the second port and starting atimer; the first port receiving the unique signal returned from thesecond port and stopping the timer; the first device allocating creditsaccording to the time elapsed on the timer; the first port sending tothe second port a message that comprises information reflecting thecredits allocated by the first device; and the second device receivingthe message and allocating credits based on the credit informationwithin the received message; wherein allocating credits according to thetime elapsed on the timer includes: calculating the distance accordingto the time elapsed on the timer; and allocating credits correspondingto the distance between the first and second ports; and whereincalculating the distance according to the time elapsed on the timer usesthe following formula:distance=(LRT_LATENCY*3)/(20*RI), where distance is the link distance inkm, LRT_LATENCY is the time lapse between timer stops and starts, inmicroseconds, and RI is the refractive index of glass (worst case) inthe fiber optic connecting the two ports.
 9. The method in claim 8,wherein the timer has a time-out limit; and wherein when the timerreaches the time-out limit before receiving the unique signal returnedfrom the second port, the timer is stopped and a message is generated.10. The method in claim 8, further comprising: the first deviceinquiring of the second device whether the second port supports a modeto dynamically allocate credits; and the second device responding to thefirst device that the second port supports the mode to dynamicallyallocate credits.
 11. The method in claim 8, further comprising: thefirst port and the second port exchanging identities wherein theidentities follows a defined sequence; wherein the first port identityis in front of the second port identity in the sequence.
 12. The methodin claim 8, wherein the link has a LINE_RATE, the raw data rate of thelink in Gb/sec and the frames transmitted has a MAX_FRAME_SIZE which isthe maximum size of a frame transmitted by the ports; and whereinallocating credits corresponding to the distance for one of the firstand second ports, the amount of credit allocated is determined by thefollowing formula:Number of credits=((20*RI*DISTANCE)/3)*(100/MAX_FRAME_SIZE)*LINE_RATE+K,where K is a constant provided to allow for intraswitch latencies. 13.The method in claim 12, wherein the first device having the first porthas one or more other ports, and the credits available on the firstdevice are allocated to connected ports on a first come, first servebasis until all credits are used.
 14. The method in claim 12, whereinthe first device having the first port has one or more other ports,further comprising: allocating the amount of credits to each port, suchthat:Nai=Ni*(Total number of credits on switch)/sum(Number of credits of allports), where Nai is the amount of credits reallocated to port i, Ni isthe amount of credits allocated to port i in claim 12, and Sum (numberof credits of all ports) is the sum of credits allocated to all ports asin claim
 12. 15. A device for use in a Fibre Channel network,comprising: a Fibre Channel port for connection to another Fibre Channelport; a timer coupled to the Fibre Channel port; and a control modulecoupled to the Fibre Channel port and the timer; wherein the controlmodule is operable to send and receive a unique signal through the FibreChannel port; and to tell the time elapsed between sending the uniquesignal and receiving the unique signal, using the timer; wherein thecontrol module is further operable to allocate a number of credits basedon the time elapsed between sending the unique signal and receiving theunique signal; and to send a message through the Fibre Channel port, themessage including information reflecting the number of creditsallocated; and wherein the number of credits allocated is determined byformula:Number of credits=(LRT_LATENCY*LINE_RATE*100)/MAX_FRAME_SIZE+K, whereLRT_LATENCY is the time lapse between timer stops and starts, inmicroseconds, LINE_RATE is the raw data rate of the link in Gb/sec,MAX_FRAME_SIZE is the maximum size of a frame transmitted by the ports,and K is a constant provided to allow for intradevice latencies.
 16. Thedevice in claim 15, wherein the timer has a time-out limit; and whereinwhen the timer reaches the time-out limit, the control module willgenerate a message.
 17. The device in claim 15, wherein the controlmodule is further operable to send an inquiry and to receive a responsewhether the other Fibre Channel port connected to the Fibre Channel portsupports a mode to dynamically allocate credits.
 18. A Fibre Channelswitch for an information network, said switch comprising: a first FibreChannel port and a second Fibre Channel port, the first port forconnection to another Fibre Channel port and the second port forconnection to another Fibre Channel port; a memory; a timer coupled tothe first port; and a control module coupled to the first port and thetimer; wherein the control module is operable to send and receive aunique signal through the first port; and to tell the time elapsedbetween sending the unique signal and receiving the unique signal, usingthe timer; wherein the control module is further operable to allocate anumber of credits to the first port based on the time elapsed betweensending and receiving the unique signal; and to send a message throughthe first port, the message including information reflecting the numberof credits allocated; and wherein the number of credits allocated isdetermined by formula:Number of credits=(LRT_LATENCY*LINE_RATE*100)/MAX_FRAME_SIZE+K, whereLRT_LATENCY is the time lapse between timer stops and starts, inmicroseconds, LINE_RATE is the raw data rate of the link in Gb/sec,MAX_FRAME_SIZE is the maximum size of a frame transmitted by the ports,and K is a constant provided to allow for intradevice latencies.
 19. TheFibre Channel switch in claim 18, wherein the second port is operable toreceive and return a unique signal.
 20. The Fibre Channel switch inclaim 18, wherein the timer has a time-out limit; and wherein when thetimer reaches the time-out limit, the control module will generate amessage.
 21. The Fibre Channel switch in claim 18, wherein the controlmodule is further operable to send an inquiry and to receive a responsewhether another Fibre Channel port connected to the first port supportsa mode to dynamically allocate credits.
 22. The Fibre Channel switch inclaim 18, wherein the control module is operable to allocate the creditsavailable on the switch to connected ports on a first come first servebasis until all credits are used.
 23. The Fibre Channel switch in claim18, wherein the control module is operable to allocate the amount ofcredits to each port, such that:Nai=Ni*(Total number of credits on switch)/sum(Number of credits of allports), where Nai is the amount of credits reallocated to port i, Ni isthe amount of credits allocated to port i in claim 18, and Sum (numberof credits of all ports) is the sum of credits allocated to all ports asin claim
 18. 24. A Fibre Channel network comprising: a first switchincluding: a first port; a timer; and a first control module coupled tothe first port and the timer; and, a second switch including: a secondport connected to the first port on the first switch; and a secondcontrol module; wherein the first control module is operable to send andreceive a unique signal through the first port; and to tell the timeelapsed between sending the unique signal and receiving the uniquesignal, using the timer; wherein the first control module is furtheroperable to allocate a number of credits to the first port based on thetime elapsed between sending and receiving the unique signal; and tosend a message to the second port, the message including informationreflecting the number of credits allocated; wherein the second port isoperable to receive and return the unique signal, and to receive themessage; wherein the second control module is operable to allocatecredits based on the credit information within the received message; andwherein the number of credits allocated is determined by formula:Number of credits=(LRT_LATENCY*LINE_RATE*100)/MAX_FRAME_SIZE+K, whereLRT_LATENCY is the time lapse between timer stops and starts, inmicroseconds, LINE_RATE is the raw data rate of the link in Gb/sec,MAX_FRAME_SIZE is the maximum size of a frame transmitted by the ports,and K is a constant provided to allow for intraswitch latencies.
 25. TheFibre Channel network in claim 24, wherein the timer has a time-outlimit, and wherein when the timer reaches the time-out limit, the firstcontrol module will generate a message.
 26. The Fibre Channel network inclaim 24, wherein the first control module through the first port, isfurther operable to send an inquiry to and receive a response from thesecond port whether the second port supports a mode to dynamicallyallocate credits, and wherein the second control module through thesecond port, is further operable to receive the inquiry from and sendthe response to the first port whether the second port supports a modeto dynamically allocate credits.
 27. The Fibre Channel network in claim24, wherein the first control module is operable to allocate the creditsavailable on the switch to connected ports on a first come first servebasis until all credits are used.
 28. The Fibre Channel network in claim24, wherein the control module is operable to allocate the amount ofcredits to each port, such that:Nai=Ni*(Total number of credits on switch)/sum(Number of credits of allports), where Nai is the amount of credits reallocated to port i, Ni isthe amount of credits allocated to port i in claim 24, and Sum (numberof credits of all ports) is the sum of credits allocated to all ports asin claim
 24. 29. A Fibre Channel network system comprising: a firstnode; a second node; a first switch including: a first port; a thirdport coupled to the first node; a timer; and a first control modulecoupled to the first port and the timer; a second switch including: asecond port connected to the first port on the first switch; a fourthport coupled to the second node; and a second control module; whereinthe first control module is operable to send and receive a unique signalthrough the first port; and is operable to tell the time elapsed betweensending the unique signal and receiving the unique signal, using thetimer; wherein the first control module is further operable to allocatea number of credits to the first port based on the time elapsed betweensending and receiving the unique signal; and to send a message to thesecond port, the message including information reflecting the number ofcredits allocated; wherein the second port is operable to receive andreturn the unique signal, and to receive the message; wherein the secondcontrol module is operable to allocate credits based on the creditinformation within the received message; and wherein the number ofcredits allocated is determined by formula:Number of credits=(LRT_LATENCY*LINE_RATE*100)/MAX_FRAME_SIZE+K whereLRT_LATENCY is the time lapse between timer stops and starts, inmicroseconds, LINE_RATE is the raw data rate of the link in Gb/sec,MAX_FRAME_SIZE is the maximum size of a frame transmitted by the ports,and K is a constant provided to allow for intraswitch latencies.
 30. TheFibre Channel network system in claim 29, wherein the timer has atime-out limit; and wherein when the timer reaches the time-out limit,the first control module will generate a message.
 31. The Fibre Channelnetwork system in claim 29, wherein the first control module through thefirst port, is further operable to send an inquiry to and receive aresponse from the second port whether the second port supports a mode todynamically allocate credits; and wherein the second control modulethrough the second port, is further operable to receive the inquiry fromand send the response to the first port whether the second port supportsa mode to dynamically allocate credits.
 32. The Fibre Channel networksystem in claim 29, wherein the first control module is operable toallocate the credits available on the switch to connected ports on afirst come first serve basis until all credits are used.
 33. The FibreChannel network system in claim 29, wherein the control module isoperable reallocate the amount of credits to each port, such that:Nai=Ni*(Total number of credits on switch)/sum(Number of credits of allports), where Nai is the amount of credits reallocated to port i, Ni isthe amount of credits allocated to port i in claim 29, and Sum (numberof credits of all ports) is the sum of credits allocated to all ports asin claim 29.